﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace ObviousCode.Stately
{
    public static class ObjectExtensions
    {
        [DebuggerStepThrough()]
        public static T As<T>(this object item) where T : class
        {
            return item as T;
        }

        [DebuggerStepThrough()]
        public static T To<T>(this object item)
        {
            return (T)item;
        }

        [DebuggerStepThrough()]
        public static bool IsNot<T>(this T me, T item)
        {
            return !me.Equals(item);
        }
    }
}
